package myjobs;

import ircbot.AbstractJob;
import ircbot.Bot;

/**
 *
 * @author andreas
 */
public class GreeterJob extends AbstractJob {
    Bot bot;
    String channel;

    public GreeterJob(Bot bot, String channel) {
        this.bot = bot;
        this.channel = channel;
    }

    @Override
    public void onJoin(String channel, String sender, String login, String hostname)  {
        if(!sender.equalsIgnoreCase(bot.getNick()) && this.channel.equalsIgnoreCase(channel)) {
            bot.sendMessage(channel, "Greetings " + sender);
        }
    }
}
